# example.py
import aika_seh_wubi as aika

def main():
    # 创建五笔符号
    ren = aika.WuBiSymbol("W", "人")  # 人字，五笔编码W
    gong = aika.WuBiSymbol("A", "工")  # 工字，五笔编码A
    zhi = aika.WuBiSymbol("T", "智")  # 智字，五笔编码T
    neng = aika.WuBiSymbol("E", "能")  # 能字，五笔编码E
    
    # 计算语义相似度
    print(f"'人'和'工'的语义相似度: {ren.similarity(gong)}")
    print(f"'智'和'能'的语义相似度: {zhi.similarity(neng)}")
    
    # 创建语义推理器
    reasoner = aika.SemanticReasoner()
    
    # 进行语义推理
    input_symbols = [ren, gong, zhi, neng]  # 人工智能
    result = reasoner.reason(input_symbols)
    
    print(f"推理结果: {result.inferred_symbols}")
    print(f"置信度: {result.confidence}")
    
    # 启动自主学习循环（在实际应用中需要在后台线程运行）
    # learner = aika.AutonomousLearner()
    # learner.autonomous_learning_loop()

if __name__ == "__main__":
    main()